package com.littleant.repository;

import com.littleant.model.ConfigurationDataEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2016/11/7.
 */
public interface DataRepository extends JpaRepository<ConfigurationDataEntity, Integer>{
    @Query(value="from ConfigurationDataEntity where dataPid=:nn")
    List<ConfigurationDataEntity> findByName3(@Param("nn") int dataPid);

    @Query(value="from ConfigurationDataEntity where dataType in('0','1','2','Section','section')")
    List<ConfigurationDataEntity> findPart();

    @Query(value = "select max(dataId) from ConfigurationDataEntity")
    int findMaxId();

}
